function getQueryVariable() {
    var query = window.document.location.href.toString();
    var query = query.split("?");
    var vars = query[1].split("&");
    var res = [];
    for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");
        res[pair[0]] = pair[1];
    }
    return res;
}

$(function(){
    try {
        var itemsids = getQueryVariable()["id"] //获取id
    }catch(e){
        layer.msg('不要瞎传输数据！', {
            time:0,
            btn: '确定',
            btnAlign: 'c'
        });

    }
    // 从url获取到参数然后从参数中解析数据，解析之后请求
    //请求后台
    console.log(itemsids)
    lilist = []
    $.ajax({
        type: 'POST',
        url: "/remarks/getGgRemarkAll",
        data:{
            token: itemsids
        },
        success: function (message) {
            if(message.code==0){
                //名字昵称
                if(message.data.length > 0){
                    for (i=0;i<message.data.length;i++){
                        var items =
                            '<li class="layui-timeline-item">'+
                            '<i class="layui-icon layui-timeline-axis"></i>'+
                            '<div class="layui-timeline-content layui-text">'+
                            '<h3 class="layui-timeline-title">'+message.data[i].ggRTime+'</h3>'+
                            '<p>'+message.data[i].ggRCount+'</p>'+
                            '</div>'+
                            '</li>'
                        lilist.push(items)
                    }
                    $(remarksLi).append(lilist)
                }else {
                    $(remarksLi).append('<p>没有增加过备注哦，请点击增加备注新增备注！</p>')
                }

            }
        }
    })
})
